package com.zyz.B_流程控制.综合练习;

import java.util.Scanner;

/**
 * @author: vick
 * @Date: 2025/3/11
 * @Description:
 * @version: 1.0
 */
public class Demo2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入学生人数：");
        int numberStudents = scanner.nextInt();
        //总分数
        double totalScore = 0;
        for (int i = 1; i < numberStudents; i++) {
            System.out.println("请输入第" + i + "个学生的成绩：");
            double score = scanner.nextDouble();
            totalScore += score;
        }

        double averageStudent = totalScore/ numberStudents;
        System.out.println("学生的平均成绩：" + averageStudent);
        scanner.close();
    }
}
